package com.igeek.yygh.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.igeek.yygh.constant.MessageConstant;
import com.igeek.yygh.model.Servicenty;
import com.igeek.yygh.model.elders.Elders;
import com.igeek.yygh.result.Results;
import com.igeek.yygh.service.EldersService;
import com.igeek.yygh.service.ServiceService;
import com.igeek.yygh.vo.PageQueryVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2024-08-21
 */
@RestController
@RequestMapping("/admin/service")
@Slf4j
@Api(tags = "服务管理")
public class ServiceController {
    @Autowired
    private ServiceService service;
    @GetMapping("findPage")
    @ApiOperation("条件分页查询检查项信息")
    public Results findPage(PageQueryVO vo){
        try {
            Page<Servicenty> page = service.findPage(vo);
            if(page!=null){
                return new Results(true , MessageConstant.QUERY_CHECKITEM_SUCCESS,page);
            }
        }catch (Exception e){
            e.printStackTrace();
        }
        return new Results(false , MessageConstant.QUERY_CHECKITEM_FAIL);
    }

}
